package com.my.ads.lib;

import android.content.Context;
import android.widget.RelativeLayout;

/**
 * Created by xuanyang on 2018/3/16.
 */

public class AdSummary {


    public void cacheAllAd(Context context) {

        AdxUtils.getInstance().cacheAdxInterstitialAd(context);
        AdxUtils.getInstance().cacheAdxNativeAd(context);
        AdxUtils.getInstance().cacheAdxBannerAd(context);

    }


    public void showNativeAd(Context context, final RelativeLayout nativeAdContainer, boolean isFromLockScreen) {
        try {

            AdxUtils.getInstance().showAdxNativeAd(context, nativeAdContainer, isFromLockScreen);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    public void showInterstitialAd(Context context, final String targetActivity) {

        try {

            AdxUtils.getInstance().showAdxInterstitialAd(context, targetActivity);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    public void showBannerAd(final RelativeLayout bannerAdContainer) {
        AdxUtils.getInstance().showAdxBannerAd(bannerAdContainer);
    }


    private static AdSummary instance = new AdSummary();

    public static AdSummary getInstance() {
        return instance;
    }
}
